//
//  FoundTableViewCell.m
//  FVQuickMessage
//
//  Created by HoiChen on 16/8/10.
//  Copyright © 2016年 zty. All rights reserved.
//

#import "FoundTableViewCell.h"

@implementation FoundTableViewCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.foundIconImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_foundIconImageView];
        
        self.foundTitleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_foundTitleLabel];
        
        [self config];
    }
    
    return self;
}

- (void) config {
    
    [self.foundIconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).with.offset(10);
        make.left.equalTo(self.contentView).with.offset(10);
        make.width.offset(40);
        make.height.offset(40);
    }];
    
    [self.foundTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.foundIconImageView.mas_top).with.offset(5);
        make.left.equalTo(self.foundIconImageView.mas_right).with.offset(10);
        make.width.offset(200);
        make.height.offset(30);
    }];
    
}

-(void)setName:(NSString *)name {
    
    _name = name;
    
    self.foundIconImageView.image = [UIImage imageNamed:name];
    
    self.foundTitleLabel.text = name;
    
}

@end
